# 目标模块名称
obj-m += pcie_canfd.o
# 指定模块由多个源文件组成
pcie_canfd-objs := pcie_cdev_canfd.o xcan_dev.o

# 交叉编译工具链
CROSS_COMPILE ?= /media/test/sde/ubuntu2204/rk3588/tl3588-evm_buildroot-2021.11_v2.2/rk3588_linux_release/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
# CROSS_COMPILE ?= /media/test/sde/ubuntu2204/rk3568/tl3568f-evm_v1.5/rk356x_linux_release_v1.3.1/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-

# 目标架构
ARCH ?= arm64

# 目标内核源码路径
KERNEL_DIR ?= /media/test/sde/ubuntu2204/rk3588/tl3588-evm_buildroot-2021.11_v2.2/rk3588_linux_release/kernel
# KERNEL_DIR ?= /media/test/sde/ubuntu2204/rk3568/tl3568f-evm_v1.5/rk356x_linux_release_v1.3.1/kernel

# 编译选项
EXTRA_CFLAGS += -Wall

all:
	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(PWD) modules

clean:
	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(PWD) clean
